

let hkNativeDevice = (function () {

    let camera = function (data,callback) {

        window.hkJSBridge.call({
            target: "Device",
            action: "camera",
            data: data,
            callback: callback,
        });
    };
    let album = function (data,callback) {

        window.hkJSBridge.call({
            target: "Device",
            action: "album",
            data: data,
            callback: callback
        });
    };
    let location = function (data,callback) {

        window.hkJSBridge.call({
            target: "Device",
            action: "location",
            data: data,
            callback: callback
        });
    }
    return{
        camera:camera,
        album:album,
        location:location
    }
})();


let hkNativePage = (function () {

    let openPage = function (data,callback) {

        window.hkJSBridge.call({
            target: "Page",
            action: "openPage",
            data: data,
            callback: callback
        });
    };
    let closePage = function (data,callback) {

        window.hkJSBridge.call({
            target: "Page",
            action: "closePage",
            data: data,
            callback: callback
        });
    };

    return{
        openPage:openPage,
        closePage:closePage
    }
})();


let hkNativeStore = (function () {

    let save = function (data,callback) {

        window.hkJSBridge.call({
            target: "Store",
            action: "save",
            data: data,
            callback: callback
        });
    };
    let get = function (data,callback) {

        window.hkJSBridge.call({
            target: "Store",
            action: "get",
            data: data,
            callback: callback
        });
    };

    return{
        save:save,
        get:get
    }
})();


let hkNativeHttp = (function () {

    let get = function (data,callback) {

        window.hkJSBridge.call({
            target: "Http",
            action: "get",
            data: data,
            callback: callback
        });
    };
    let post = function (data,callback) {

        window.hkJSBridge.call({
            target: "Http",
            action: "post",
            data: data,
            callback: callback
        });
    };

    return{
        get:get,
        post:post
    }
})();


let hkNativeScan = (function () {

    let barCode = function (data,callback) {

        window.hkJSBridge.call({
            target: "Scan",
            action: "barCode",
            data: data,
            callback: callback
        });
    };

    return{
        barCode:barCode
    }
})();


